﻿/*****************************************************************//**
 * @file   VAOneXMLAdaptorSubsystemsCavity.h
 * @brief  VAOne读写SEA声腔子系统适配器
 *
 * @author lilongyuan (lilongyuan@diso.cn)
 * @date   2025-02-10
 *********************************************************************/
#ifndef VAONEXMLADAPTORSUBSYSTEMSCAVITY_H
#define VAONEXMLADAPTORSUBSYSTEMSCAVITY_H

#include "FITKAbstractVAOneXMLAdaptor.h"

namespace Acoustics
{
    class FITKSEASubSysCavity;
}

namespace IO
{
    /**
     * @brief   VAOne读写SEACavity适配器
     * @author  lilongyuan (lilongyuan@diso.cn)
     * @date    2025-02-10
     */
    class FITKVAOneXMLIOAPI VAOneXMLAdaptorSubsystemsCavity : public FITKAbstractVAOneXMLAdaptor
    {
        FITKCLASS(IO, VAOneXMLAdaptorSubsystemsCavity);
    public:
        /**
         * @brief   构造函数
         * @author  lilongyuan (lilongyuan@diso.cn)
         * @date    2025-02-10
         */
        explicit VAOneXMLAdaptorSubsystemsCavity() = default;
        /**
         * @brief   析构函数
         * @author  lilongyuan (lilongyuan@diso.cn)
         * @date    2025-02-10
         */
        ~VAOneXMLAdaptorSubsystemsCavity() = default;
        /**
         * @brief   适配器读数据
         * @return  是否执行成功
         * @author  lilongyuan (lilongyuan@diso.cn)
         * @date    2025-02-10
         */
        virtual bool adaptR() override;
        /**
         * @brief   适配器写数据
         * @return  是否执行成功
         * @author  lilongyuan (lilongyuan@diso.cn)
         * @date    2025-02-10
         */
        virtual bool adaptW() override;
    private:
        /**
         * @brief     读取SEA声腔子系统数据接口
         * @param[i]  node Cavity节点，data SEA声腔子系统数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-11
         */
        bool readCavity(rapidxml::xml_node<char>* node, Acoustics::FITKSEASubSysCavity* data);
        /**
         * @brief     读取损耗因子频谱数据
         * @param[i]  node Cavity节点，data SEA声腔子系统数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-11
         */
        bool readDamping(rapidxml::xml_node<char>* node, Acoustics::FITKSEASubSysCavity* data);
        /**
         * @brief     读取子节点数据
         * @param[i]  node Cavity节点，data SEA声腔子系统数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-11
         */
        bool readChildNode(rapidxml::xml_node<char>* node, Acoustics::FITKSEASubSysCavity* data);
        /**
         * @brief     读取几何属性数据
         * @param[i]  node Cavity节点，data SEA声腔子系统数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-11
         */
        bool readGeometricProperty(rapidxml::xml_node<char>* node, Acoustics::FITKSEASubSysCavity* data);
        /**
         * @brief     写出SEA声腔子系统数据接口
         * @param[i]  node Cavity节点，data SEA声腔子系统数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-12
         */
        bool writeCavity(rapidxml::xml_node<char>* node, Acoustics::FITKSEASubSysCavity* data);
        /**
         * @brief     写出SEA声腔子系统属性数据
         * @param[i]  node Cavity节点，data SEA声腔子系统数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-12
         */
        bool writeCavityAttribute(rapidxml::xml_node<char>* node, Acoustics::FITKSEASubSysCavity* data);
        /**
         * @brief     写出几何属性数据
         * @param[i]  node Cavity节点，data SEA声腔子系统数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-12
         */
        bool writeGeometricProperty(rapidxml::xml_node<char>* node, Acoustics::FITKSEASubSysCavity* data);
        /**
         * @brief     写出子节点数据
         * @param[i]  node Cavity节点，data SEA声腔子系统数据对象
         * @return    是否执行成功
         * @author    lilongyuan (lilongyuan@diso.cn)
         * @date      2025-02-12
         */
        bool writeChildNode(rapidxml::xml_node<char>* node, Acoustics::FITKSEASubSysCavity* data);
    };
    Register2FITKIOAdaptorFactory(VAOneXML, Cavity, VAOneXMLAdaptorSubsystemsCavity)
}

#endif // VAONEXMLADAPTORSUBSYSTEMSCAVITY_H

